package com.wwlwxg.spring_security;


import com.wwlwxg.spring_security.config.TTConfig;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.sql.DataSource;
import java.util.Map;


//@ServletComponentScan(basePackages = "") // 扫描 servlet 原生组件的包 @WebServlet @WebFilter @WebListener
@EnableGlobalMethodSecurity(securedEnabled = true, prePostEnabled = true)
@MapperScan("com.wwlwxg.spring_security.mapper")
@EnableConfigurationProperties({TTConfig.class})
@SpringBootApplication
public class Application {

  public static void main(String[] args) {
    ConfigurableApplicationContext run = SpringApplication.run(Application.class, args);
    Map<String, DataSource> beansOfType = run.getBeansOfType(DataSource.class);
    Map<String, JdbcTemplate> beansOfType1 = run.getBeansOfType(JdbcTemplate.class);
    System.out.println(run.getBeansOfType(WebMvcConfigurer.class).keySet());
  }
}
